home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 118 (1989-11-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 118 (1989-11-15)(Ossowski, Stefan)(DE)(PD).adf / SimGen / SimGen.doc < prev    next >
Text File  |  1989-09-25  |  19KB  |  470 lines

  1.  
  2.                           SimGen
  3.  
  4.                      by Gregg Tavares
  5.  
  6.                       © 1989 Echidna
  7.  
  8.                       BIX:   echidna
  9.                       PLINK: GreggT
  10.                       CIS:   72411,2772
  11.  
  12.  
  13. -=> Try this <=-
  14.  
  15. CD to the directory where you unZOOed these files and
  16. type.
  17.  
  18. run SimGen MCastle.200x4
  19.  
  20. Now run some other programs that use the WorkBench for
  21. their displays.  Pretty neat, ay?
  22.  
  23.  
  24. -=> SimGen, What does it do? <=-
  25.  
  26. Well, SimGen displays a 2 or 4 color IFF picture "behind"
  27. your WorkBench.  If the IFF picture is a digitized picture
  28. it looks much like a GenLocked Display; hence the name
  29. SIMGEN for 'SIMulated GENlock'.
  30.  
  31.  
  32. -=> How does SimGen work? <=-
  33.  
  34. SimGen Adds 1 or 2 bitplanes to your WorkBench Screen and
  35. loads the specified picture into these bitplanes.  Then it
  36. sets the colors for the desired effect.
  37.  
  38. Example SimGen color registers for a 4 color picture:
  39.  
  40.    Color 0  = Color 0 from PICTURE.
  41.    Color 1  = Color 1 from WorkBench.
  42.    Color 2  = Color 2 from WorkBench.
  43.    Color 3  = Color 3 from WorkBench.
  44.    Color 4  = Color 1 from PICTURE.
  45.    Color 5  = Color 1 from WorkBench.
  46.    Color 6  = Color 2 from WorkBench.
  47.    Color 7  = Color 3 from WorkBench.
  48.    Color 8  = Color 2 from PICTURE.
  49.    Color 9  = Color 1 from WorkBench.
  50.    Color 10 = Color 2 from WorkBench.
  51.    Color 11 = Color 3 from WorkBench.
  52.    Color 12 = Color 3 from PICTURE.
  53.    Color 13 = Color 1 from WorkBench.
  54.    Color 14 = Color 2 from WorkBench.
  55.    Color 15 = Color 3 from WorkBench.
  56.  
  57. To those that don't care how it works, just suffice it to
  58. say that it looks real neat!
  59.  
  60.  
  61. -=> Are there any negative side effects? <=-
  62.  
  63. Yes.
  64.  
  65. 1) SimGen takes about 25K to run and another 16K to 64K
  66.    for the picture it loads.  If you load a 2 color
  67.    picture on a 640x200 WorkBench the picture will take
  68.    16K.
  69.  
  70. WorkBench Size | Colors In Picture | Memory
  71. ---------------+-------------------+-----------
  72.    640x200     |        2          |   16K
  73.    640x200     |        4          |   32K
  74.    640x400     |        2          |   32K
  75.    640x400     |        4          |   64K
  76.    708x480     |        4          |   85K
  77.  
  78.  
  79. -=> What will SimGen Work With? <=-
  80.  
  81. SimGen should work with any size WorkBench Screen.  It most
  82. likely will not work with other WorkBench Hacks like
  83. DropCloth or DropShadow nor will it work with 8 and 16
  84. color WorkBenchs.  It will work with Interlaced,
  85. Non-Interlaced and Overscan WorkBenchs (MoreRows).
  86.  
  87. Adding more colors to your WorkBench also slows it down. 
  88. This is because the electronics in your Amiga that display
  89. graphics and your Amiga's CPU or 68000 microprocessor can't
  90. both read your computers memory at the same time.  Much of
  91. the time this is not a problem.  The memory in your Amiga
  92. can only be read about 14 million times a second (I Think).
  93. The 68000 can normally only use the memory every other one
  94. of those times or 7 million times a second.  The creators
  95. of the Amiga designed it so that the display electronics
  96. (and other electronics for sound and disk support) read the
  97. memory the rest of the time and so everything runs smooth,
  98. but, when you have a screen that is HIRES (640 or more
  99. pixels across) and more than 4 colors, the display
  100. electronic have to read lots of memory to display your
  101. graphics, more memory than they can read with their 7
  102. million opportunities each second and so they use some of
  103. the 68000's opportunities which means your 68000 can't use
  104. the memory as often as usual which in turn means your Amiga
  105. will run a little slower.  (Other modes like
  106. Hold-And-Modify "HAM" and Extra-Halfbrite have the same
  107. effect.)
  108.   I haven't noticed SimGen slowing my Amiga down to much. 
  109. Certainly not as much as DropCloth, DropShadow, or an 8 or
  110. 16 color WorkBench.  This is because all of those programs
  111. either actually draw on your WorkBench screen everytime you
  112. move a Window or they tell the WorkBench it has more colors
  113. and therefore the WorkBench must draw all its windows and
  114. graphics in 8 or 16 colors instead of 4 which requires more
  115. work and takes more time.
  116.   SimGen adds colors to the WorkBench's display but it
  117. doesn't need to tell WorkBench about it so WorkBench still
  118. thinks it is only using 4 colors and therefore performs
  119. better.
  120.  
  121.  
  122. -=> How do I run it? <=-
  123.  
  124. SimGen may be run from the CLI or the WorkBench.
  125.  
  126. From the WorkBench, just single-click on any IFF Picture
  127. Icon, hold the shift button and double-click on the SimGen
  128. Icon.  (See picture requirements and suggestions below.)
  129.  
  130. You may also edit your Pictures' icons to run SimGen
  131. directly.  To do this, single-click on your chosen IFF
  132. Picture Icon and then choose "Info" from the "WorkBench"
  133. menu.  When the "Info" Window appears, click in the
  134. "Default Tool" box and change it from whatever it is to
  135. the path where you keep SimGen.  If you put SimGen in
  136. your C: directory then you would set the "Default Tool"
  137. to 'C:SimGen'.  If you keep SimGen in on a Disk named
  138. "Hacks" you might set the "Default Tool" to
  139. 'Hacks:SimGen'.
  140.  
  141. To "Remove" SimGen, from the WorkBench, Double-Click on the
  142. SimGen Icon.  A Small Help window should appear with the
  143. option to "Remove".  Click on it and SimGen will remove
  144. itself from your System.
  145.  
  146. From the CLI you would type SimGen [picture] where
  147. [picture] is the path and name of the picture you want to
  148. load.  If the picture you want to load is called
  149. 'RayTrace' and is on a disk in drive DF1: you would type
  150.  
  151.   SimGen DF1:RayTrace.
  152.  
  153. The problem with this is that you won't get your CLI
  154. back.  To get your CLI back make sure your CLI window is
  155. the active window and press CTRL-C.  (That's both the key
  156. labeled 'CTRL' on the left side of your keyboard and the
  157. 'C' key at the same time)  It is more likely you do not
  158. wish to tie up your CLI so you would usually type
  159. something like.
  160.  
  161.   run SimGen DF1:RayTrace
  162.  
  163. or
  164.  
  165.   runback SimGen DF1:RayTrace
  166.  
  167. When you do this you will not be able to use CTRL-C to
  168. remove SimGen.  To remove SimGen you may type
  169.  
  170.   SimGen -r
  171.  
  172. '-r' is for Remove.  Or you may send a CTRL-C to SimGen. 
  173. To do this type
  174.  
  175.   Status
  176.  
  177. You will see something like this.
  178.  
  179.   Process  1: Loaded as command: status
  180.   Process  2: Loaded as command: SimGen
  181.  
  182. Notice that it says Process 2 is SimGen.  Now to send a
  183. CTRL-C to process 2 type
  184.  
  185.   Break 2
  186.  
  187. SimGen should exit Immediatly.
  188.  
  189. You don't need to "Remove" SimGen before you re-run it
  190. with another picture.  SimGen will remove the any
  191. previously loaded picture automatically.
  192.  
  193.  
  194. -=> How does SimGen handle IFF Pictures? <=-
  195.  
  196. SimGen will load any IFF picture but it will only use at
  197. most the first 2 bitplanes (although it will load all the
  198. bitplanes of the picture.)  This means you would probably
  199. only want to use 2 or 4 color pictures.  SimGen will also
  200. only use as much of the picture as it can fit on the
  201. WorkBench Screen.  If the picture you load is bigger than
  202. the current WorkBench screen it will be centered and the
  203. edges chopped off.  If the picture you load is smaller, by
  204. default it will be centered in the middle of the screen.
  205.   There is an option to 'Tile' a small picture.  This
  206. option uses a small picture or brush as a 'pattern'.  If
  207. the brush you are using is called 'rods' and is in the
  208. current directory and you want to 'Tile' it you would
  209. type something like.
  210.  
  211.     run SimGen -t rods
  212.  
  213. This will start the 'Tiling' from the Top, Left corner of
  214. the screen.  Sometimes this is not desirable so you may
  215. give the picture an offset.  Typing
  216.  
  217.     run SimGen -t10,20 rods
  218.  
  219. will start the 'Tiling' 10 pixels from the left of the
  220. screen and 20 pixels from the top.
  221.  
  222. From the WorkBench you make select 'Tiling' by adding the
  223. line 'TILE' in your picture's 'Tool Types'.  (See Below
  224. for how to edit 'Tool Types'.)  You may set the tiling
  225. offset by specifing it after the word 'TILE' as in
  226. 'TILE=10,20' (Note: TILE must be all capital letters, the
  227. equal sign '=' is NOT optional, and you shouldn't have any
  228. spaces around the numbers.)
  229.  
  230.  
  231. -=> What other options does SimGen have? <=-
  232.  
  233. From the CLI       '-w'
  234. From the WorkBench 'WORKBENCH'
  235.  
  236. This option is supposed to keep SimGen around even after
  237. some other program has closed the WorkBench and the
  238. Re-Opened it.  I wasn't sure of a safe way to do this yet
  239. so it is NOT IMPLEMENTED.
  240.  
  241. From the CLI       '-k'
  242. From the WorkBench 'KEEPCOLORS'
  243.  
  244. This option is supposed to keep the colors correct even
  245. after some other program has changed them (like
  246. Preferences).  The colors are currently only set once when
  247. you first run the program as I couldn't think of a way to
  248. do this safely (yet.).  If you change your WorkBench colors
  249. while SimGen is running it would probably be best to re-run
  250. SimGen.
  251.  
  252. From the CLI        '-p<PickFile>'
  253. Not Available from the WorkBench
  254.  
  255. This option allows you to create a text file that lists all
  256. the pictures you might like to use with SimGen.  SimGen
  257. will the look at that file and pick one picture at random. 
  258. The first line of the file should contain the number of
  259. choices SimGen has to pick from.  The rest of the lines
  260. should contain the choices in the form of Double-Quoted
  261. filenames. An Example PickFile might look like this.
  262.  
  263. 3
  264. "Pictures:Bozo"
  265. "Pictures:RayTrace"
  266. "Pictures:Rods"t10,20
  267.  
  268. Notice the last line contains the 'Tiling option'. If you
  269. want picture tiled you must put a 't' immediatly after
  270. the closing double-quote followed by optional offset
  271. information.  If you save this PickFile as 'PictureList'
  272. in the current directory you would use it by typing
  273.  
  274.    run SimGen -pPictureList
  275.  
  276. You would most likely use this option in your
  277. startup-sequence if you are lucky enough to have a Hard
  278. Drive and you want SimGen to pick a picture at random
  279. everytime you turn on/reboot your Amiga.
  280.   If the list of pictures is short you may specify them
  281. on the command line as in
  282.  
  283.     run SimGen Pictures:Bozo Picture:RayTrace.
  284.  
  285. Note: You can't specify separate Tiling options for each
  286. picture from the command line.
  287.  
  288.  
  289. -=> How to Set Tool Types. <=-
  290.  
  291. Setting 'Tool Types' of a picture is much like setting the
  292. 'Default Tool' of a picture.  First, single-click on your
  293. chosen picture.  Then choose "Info" from the "WorkBench"
  294. menu.  When the "Info" Window appears, click on the "ADD"
  295. button in the 'Tool Types' area.  This will add another
  296. 'Tool Type'.  Type the option you wish to add and press
  297. RETURN.  Now click 'SAVE' on the lower left area of the
  298. "Info" Window.  (For more information on Editing 'Tool
  299. Types' see your Amiga User's Guide).  Note: The Info
  300. Window's 'Tool Types' edit options are buggy and will
  301. sometime mess up your 'Tool Types.'  If you set your 'Tool
  302. Types' and then Click on the Picture Icon and the option
  303. you set doesn't work.  Check to see (by bringing up the
  304. "Info" window again) that the "Info" window correctly saved
  305. your 'Tool Types.'
  306.  
  307.  
  308. -=> Requirements and Suggestions for Pictures <=-
  309.  
  310. Most of the picture included with SimGen were pictures
  311. found on local BBSes and from Users Group that we ran
  312. through the Digi-View 3.0 software.  You can by this
  313. software for as little as $15 at your local Amiga
  314. Dealer/Mail Order House.  This software is an invaluable
  315. tool for image processing (without buying the actual
  316. Digi-View Digitizer that the software was written for).  It
  317. will allow you to choose a display mode and a number of
  318. colors and then will load any IFF picture and 'massage' the
  319. picture into the requested mode with dithering and all. 
  320. This is much more than Pixmate or Butcher will do in this
  321. particular area.
  322.   We chose HIRES (YES) / INTERLACE (NO) when entering
  323. Digi-View 3.0.  If you are making SimGen pictures for an
  324. Interlaced WorkBench then Choose INTERLACE (YES).  Now,
  325. click " OK " after getting the "No Video Signal Present"
  326. message.   Go to the menus and from the "Controls" menu
  327. choose "Palette".  Now set the colors to 4 then chose "OK".
  328. Now Load any IFF Picture.  It will take a while to load
  329. because Digi-View is expanding the picture into it's own
  330. internal format so that it can munipulate it better.  Once
  331. it is done loading, it will draw the picture in 4 colors.
  332.   There are many options in Digi-View that will help you
  333. get the best results.  Here are a few of tips.
  334.   1) Since we told Digi-View it could only use 4 colors
  335. it has to pick 4 colors to use.  Usually it picks the 4
  336. most common colors in the picture.  If you have a picture
  337. of a brown tree with green leaves but most of the picture
  338. is dithered shades of blue sky, Digi-View might pick four
  339. shades of blue which means the tree and its leaves will be
  340. drawn in dithered shades of blue.  This is not always what
  341. you want.  Fortunately Digi-View will let you choose the
  342. colors it should use.  Bring up the Palette Requester by
  343. choosing "Palette" from the "Controls" menu.  Now set one
  344. of the blues, in the first four colors (the ones against
  345. the left side of the screen.) to a shade of green similar
  346. to the green of the leaves.  Set another one of the blues
  347. to a shade of brown similar to the shade of the tree.  Then
  348. choose "Freeze Palette".  This will force Digi-View to use
  349. those colors.  Click on "Display" and Digi-View will
  350. re-draw your picture with the new colors.  (NOTE 1:
  351. Whenever you want Digi-View to re-draw the picture you must
  352. choose "Display" either from a button or from the Menus. 
  353. Choosing "OK" will not work.  NOTE 2: If you load another
  354. picture, you should first choose "Make New Palette" from
  355. the "Palette Requester" or Digi-View will be forced to draw
  356. the new picture with the old pictures colors.)
  357.   2) Once you have a good looking picture it is best to
  358. dim the colors.  You can use Digi-View's "Palette
  359. Requester" for this, or some other program.  (Programs like
  360. Colors (From Deluxe PhotoLab), PixMate and Butcher are
  361. great for dimming all the colors.)  The Standard white
  362. letters of the WorkBench show up well against dim/dark
  363. colors.  Also note that alot of black in your SimGen
  364. pictures is usually not a good choice because black is
  365. often a standard WorkBench color and so black objects on
  366. the WorkBench won't show up well against a largely black
  367. SimGen picture.
  368.   3) For Digitized pictures it is very easy to get decent
  369. results by first telling Digi-View to draw the picture in
  370. black and white and then changing the black and white
  371. colors to other hues using Digi-View or some other program.
  372.  
  373.  
  374. -=> Notes for Other programmers. <=-
  375.  
  376. SimGen adds bitplanes to the WorkBench by first getting
  377. the Address of the WorkBench Screen though the SimGen
  378. Credits Window.  Then, from the WorkBench Screen it makes
  379. a copy of its ViewPort's RasInfo's BitMap.  It adds the
  380. new bitplanes to this copy, points the RasInfo to the copy
  381. bitmap and then calls RemakeDisplay ().  When exiting it
  382. points the RasInfo back to it's original bitmap and again
  383. calls RemakeDisplay ().  If there is any reason you know
  384. this won't work AND you know a fix for it I would like to
  385. hear of it.
  386.  
  387. The reason the WORKBENCH and KEEPCOLOR options are not
  388. implemented is that I could not think of any reasonable way
  389. to do it.  I thought I could SetFunction, LoadRGB4, SetRGB4
  390. and OpenWorkBench, but when the WorkBench re-opens I don't
  391. know how to get its address except to open a window on it
  392. (which I obviously can't do inside these patches.)  If you
  393. have any ideas, I'd be happy to hear them.
  394.  
  395.  
  396. -=> Where did I get the idea for SimGen <=-
  397.  
  398. Well, I was at one of my local computer stores and I
  399. noticed one of the Amigas there had what I thought was a
  400. DropCloth Picture.  As I used the machine I noticed that
  401. is was more than a DropCloth.  The picture showed through
  402. all the windows including the TxEd window I was using to
  403. edit a script.  It looked pretty cool so I looked at their
  404. startup-sequence, found out what it ran to add the picture
  405. to the WorkBench and made a copy of it along with some of
  406. the pictures they used with it.  The program was called
  407. "Tapestry" written by Joe Hitchens.  I took it home and
  408. decided to show it to my roommates, but the pictures I had
  409. copied were all 640x400x1 or bigger (used on an Interlaced
  410. WorkBench.)  I don't use an Interlaced WorkBench so I set
  411. out to make some 640x200x1 pictures for my WorkBench to
  412. show off this new program.  Well, as I was creating
  413. pictures in Digi-View I accidently made a 4 color picture
  414. instead of a 2 color.  I looked at it and thought "WOW!
  415. That's really good for 2 colors."  Then I noticed it was 4
  416. colors.  I thought about it for a moment and knew it
  417. should be trivial to support 4 colors instead of 2 and I
  418. thought maybe "Tapestry" might already support 4 colors so
  419. I tried the 4 color picture.  Nope, "Tapestry" only
  420. displayed 1 bitplane of my picture. So, I thought, maybe
  421. there's a newer version on the 'boards'.  I called
  422. Compuserve. Nothing.  I called PeopleLink and found
  423. "Tapestry" and "Tapestry Version 2."  The small online
  424. description said it supported 4 colors.  So, I downloaded
  425. it and tried it out.  No luck!  The documentation said
  426. that 4 colors as well as tiling/pattern were to be added
  427. to a future version.  The doumentation was dated March 18,
  428. 1989.  It shouldn't take more than 38 seconds to add 4
  429. color support I thought, so I decided that since it was
  430. now June 4, 1989, 38 seconds had long passed since the
  431. last version of "Tapestry", and, given this, the author
  432. must have died or something.  So, instead of waiting for
  433. who knows how many more months for a 4 color version I
  434. decided to write my own.
  435.   "Tapestry" version 2 was only 11.3K big.  SimGen is
  436. 22.8.   Sorry about the size increase.  It is mostly
  437. because my IFF routines are the Electronic Arts/Commodore
  438. Amiga IFF routines heavily modified for extra
  439. functionality but not code size.
  440.   The IFF routines will load any type of IFF ILBM file
  441. including color cycling info, and ViewMode.  They will
  442. read any part of a picture to any part of a bitmap or
  443. rastport and will create the bitmap and rastport if
  444. necessary.  They will also clip to a bitmap/rastport that
  445. is smaller then the picture.  When is Commodore Amiga
  446. going to supply OS level IFF support since 50% or more of
  447. all Amiga programs could benefit from it!  I've been
  448. thinking about turning my IFF routines into a sharable
  449. library, they would be large but they would work and they
  450. do an awful lot of work.  As a sharable library they could
  451. also be updated with smaller and faster versions.
  452.   The other things that added size to SimGen are,
  453. WorkBench Support , Tiling and WorkBench Help.  The Help
  454. routines I've had for a while.  I wish Commodore Amiga
  455. would add similar routines to the Amiga OS so I wouldn't
  456. have to add them to every program I write. 
  457. (AutoRequesters are too ugly and not as functional IMHO.)
  458.  
  459.  
  460.  -=> Distrubution <=-
  461.  
  462. This program may be distrubuted as long as it is done so
  463. free of charge and all the files in the ZOO are kept
  464. together.  It may be placed on BBSes and in PD Disk
  465. Collections.  It is in other words, copywritten but Freely
  466. ReDistribuatable.
  467.  
  468. Have fun with it.  I wasted two nights writing it. :-)
  469.  
  470.